<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/Phone.php';
	
	/*
	* Class to create a phone
	*/
	class CommandCreatePhone extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct($phone) {
			$this -> phone = $phone;
		}
		
		/*
		* Method to execute to create a phone
		*/
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$icaad = $daoFactory -> getMySqlPhoneAccessDao();			
			$phoneCreation = $icaad -> createPhone($this -> phone);
	
			$this -> result = $phoneCreation;
		}
	}
?>